---
title: "Import & Export"
description: "Importing / exporting in ReScript modules"
canonical: "/docs/manual/import-export"
section: "Language Features"
order: 25
---

# Import & Export

## Import a Module/File

Unlike JavaScript, ReScript doesn't have or need import statements:

<CodeTab labels={["ReScript", "JS Output"]}>

```res
// Inside School.res
let studentMessage = Student.message
```

```js
var Student = require("./Student.res.js");
var studentMessage = Student.message;
```

</CodeTab>

The above code refers to the `message` binding in the file `Student.res`. Every ReScript file is also a module, so accessing another file's content is the same as accessing another module's content!

A ReScript project's file names need to be unique.

## Export Stuff

By default, every file's type declaration, binding and module is exported, aka publicly usable by another file. **This also means those values, once compiled into JS, are immediately usable by your JS code**.

To only export a few selected things, use a `.resi` [interface file](./module.mdx#signatures).

## Work with JavaScript Import & Export

To see how to import JS modules and export stuff for JS consumption, see the JavaScript Interop section's [Import from/Export to JS](./import-from-export-to-js.mdx).
